<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="s" uri="/struts-tags" %>
<link href="<c:url value="/skin/default/css/message.css"/>" type="text/css" rel="stylesheet">
<script charset="gbk" src="<c:url value="/skin/default/js/app/prototype.js"/>" type="text/javascript"></script>
<script charset="gbk" src="<c:url value="/skin/default/js/app/scriptaculous.js"/>" type="text/javascript"></script>
<script charset="gbk" src="<c:url value="/skin/default/js/app/effects.js"/>" type="text/javascript"></script>
<% if (request.getAttribute("struts.valueStack") != null) { %>
<%-- ActionError Messages - usually set in Actions --%>
<s:if test="hasActionErrors()">
    <div class="error" id="errorMessages">    
      <s:iterator value="actionErrors">
        <img src="<c:url value="/skin/default/images/iconWarning.gif"/>"
            alt='<fmt:message key="icon.warning"/>' class="icon" />
        <s:property escape="false"/><br>
      </s:iterator>
   </div>
   <script type="text/javascript">
		new Effect.Highlight('errorMessages');
		window.setTimeout("Effect.DropOut('errorMessages')", 2000);
	</script>
</s:if>

<%-- FieldError Messages - usually set by validation rules --%>
<s:if test="hasFieldErrors()">
    <div class="error" id="errorMessages">    
      <s:iterator value="fieldErrors">
          <s:iterator value="value">
            <img src="<c:url value="/skin/default/images/iconWarning.gif"/>"
                alt="<fmt:message key="icon.warning"/>" class="icon" />
             <s:property escape="false"/><br />
          </s:iterator>
      </s:iterator>
   </div>
   <script type="text/javascript">
		new Effect.Highlight('errorMessages');
		window.setTimeout("Effect.DropOut('errorMessages')", 2000);
	</script>
</s:if>
<% } %>

<%-- Success Messages --%>
  <s:if test="#session.messages!=null">
    <div class="message" id="successMessages">
       
        <s:iterator var="msg" value="#session.messages">
       
            <img src="<c:url value="/skin/default/images/iconInformation.gif"/>"
                alt="<fmt:message key="icon.information"/>" class="icon" />           
           <s:property value="msg"/><br/>
        </s:iterator>
    </div>
  
    <c:remove var="messages" scope="session"/>
    <script type="text/javascript">
		new Effect.Highlight('successMessages');
		window.setTimeout("Effect.DropOut('successMessages')", 5000);
	</script>
</s:if>